Password protect an individual page


You can password protect selected pages inside your wiki.

NOTE: I have tested this in Firefox, but not sure if it works in Safari or IE or other browsers. If not using Firefox, please use with caution and suggest you try on a sample page first.

1. Copy the code below and paste it into the embed widget under the 'other html' tab. This should be done at the top of the page you want passworded.

<HEAD> <SCRIPT language="JavaScript"> <!--hide var password; var pass1="password"; password=prompt('Enter Password',' '); if (password==pass1) alert('Correct. Click OK to enter.'); else { window.location="http://www.wikispaces.com/"; } //--> </SCRIPT> </HEAD>

2. Where you see the word 'password' on this line:

var pass1="password"

change to your own password.

3. The script above will take you back to wikispaces title page if the password is incorrect - just change the url on the line that begins 'window.location' to the page you want the incorrect attempt to go to.

4. Save.

5. A pop up window will appear on the page that will require a password before proceding. See example here. Type in the password - hello - into the box when requested.